package com.allwees.bs.c.module.ops.repository;

import com.allwees.bs.c.module.base.repository.BaseRepository;
import com.allwees.bs.c.module.ops.entity.PointActiveDefEntity;
import com.allwees.bs.core.model.coupon.constant.PointChangeTypeEnum;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface PointActiveDefRepository extends BaseRepository<PointActiveDefEntity, Integer> {

    @Query(value = "select t from PointActiveDefEntity t where t.isDeleted = 0 and t.status = 0 and t.uuid=:uuid")
    PointActiveDefEntity getByUuid(String uuid);

    @Query(value = "select t from PointActiveDefEntity t where t.isDeleted = 0 and t.status = 0 and t.useType=:useType")
    List<PointActiveDefEntity> findByUseType(PointChangeTypeEnum useType);
}
